package com.logistics.pick.entity.model;

import com.logistics.pick.entity.domain.PickDetail;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class PickDetailRow {

    private Integer id;

    // 拣配单
    private Integer pick;

    // 托盘
    private String container;

    // 物料编码
    private String itemCode;

    // 物料任务号
    private String itemWorkcode;

    // 工序编号
    private String itemOpNo;

    // 物料名称
    private String itemName;

    // 物料单位
    private String itemUnit;

    // 数量
    private BigDecimal itemQty;

    private String erpInvBillCode;

    public PickDetailRow(){}

    public PickDetailRow(PickDetail pickDetail){
        this.id = pickDetail.getId();
        this.pick = pickDetail.getPick();
        this.container = pickDetail.getContainer();
        this.itemCode = pickDetail.getItemCode();
        this.itemWorkcode = pickDetail.getItemWorkcode();
        this.itemOpNo = pickDetail.getItemOpNo();
        this.itemName = pickDetail.getItemName();
        this.itemUnit = pickDetail.getItemUnit();
        this.itemQty = pickDetail.getItemQty();
        this.erpInvBillCode = pickDetail.getErpInvBillCode();
    }

    public static PickDetailRow build(PickDetail pickDetail){
        return new PickDetailRow(pickDetail);
    }

}
